/******************************************************************************
//             INTEL CORPORATION PROPRIETARY INFORMATION
//  This software is supplied under the terms of a license agreement or
//  nondisclosure agreement with Intel Corporation and may not be copied
//  or disclosed except in accordance with the terms of that agreement.
//        Copyright (c) 2000-2001 Intel Corporation. All Rights Reserved.
//
//  Description:
//      Intel(R) JPEG library for X platform 
//
********************************************************************************/
#include "_ijx.h"

/******************************************************************************
// Name:            ijxPrepareStream
// Description:     Init IJBITTREAMSTATE structure. 
// Input Arguments:
//      pStreamBuf: Points to stream data buffer
//   nStreamBufLen: Specifies stream data buffer length in byte. 
//          bReset: Identifies if reset stream buffer pointer.
// Output Arguments:
//         pStream: Points to IJBITTREAMSTATE structure.
//                     
******************************************************************************/
IJXRESULT ijxPrepareStream( Ipp8u           *pStreamBuf,
                            int             nStreamBufLen,
                            int             bReset,
                            IJBITTREAMSTATE *pStream )

{
    if (NULL!=pStreamBuf && 0<nStreamBufLen) {
        bReset=TRUE;
        pStream->pBitStream=pStreamBuf;
        pStream->nMaxBufLen=(int)nStreamBufLen;
    } 

    if (bReset) {
        pStream->nUsedBufBitsLen=0;
        pStream->nMarker = IJX_MARKER_NONE;
    }

    pStream->nNumValidPrefetchedBits=0;
    
    return IJX_RTCODE_OK;
}


/* EOF */
